package site.suimu.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import site.suimu.pojo.TUser;
import site.suimu.service.TUserService;

import javax.annotation.Resource;

@Controller
public class TUserController {

    @Resource
    TUserService tUserService;


    /*
    * 用户登录
    * */
    @RequestMapping(value = "/login")
    @ResponseBody
    public String login(TUser tUser){
        if(tUserService.login(tUser)){
            return "success";
        }
        return "failed";
    }

    /*
    * 用户注册
    * */
    @RequestMapping(value = "/register")
    @ResponseBody
    public  String register(TUser tUser){
        if(tUserService.insUser(tUser)){
            return "success";
        }
        return "failed";
    }


}
